// pages/index/components/not-activation/notActivation.js
let request = require('../../../../utils/request.js')

Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    currentPage: 1,
    pageSize: 10,
    listLoading: false,
    pageInfo: { records: [], total: -1 }
  },
  ready(){
    console.log('not-activation-ready')
    //  获取客户待激活、已激活停车券
    // this.getCustParkTicket(2)
  },
  /**
   * 组件的方法列表
   */
  methods: {
      /**
   * 客户待激活、已激活停车券
   */
    getCustParkTicket(statusList){
      this.setData({ listLoading: true })
      request.http(
        '/customer/cust-ticket/page', 
        'GET', 
        { shopId: wx.getStorageSync('shopId') , statusList: statusList, currentPage: this.data.currentPage, pageSize: this.data.pageSize },
        1,
        false
      ).then(res => {
        console.log('客户停车券：', res)
        res.data.data.records.push.apply(this.data.pageInfo.records, res.data.data.records);
        this.setData({ pageInfo: res.data.data, listLoading: false })
      })
    }
  }
})
